package com.xuelang.pipeline.infrastructure.pipeline.converter;

import com.xuelang.pipeline.domain.pipeline.Pipeline;
import com.xuelang.pipeline.infrastructure.pipeline.dataobject.PipelineDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * 流水线实体与流水线DO转换器类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Mapper
public interface PipelineToPipelineDOConverter {

    PipelineToPipelineDOConverter INSTANCE = Mappers.getMapper(PipelineToPipelineDOConverter.class);

    /**
     * Pipeline转化为PipelineDO
     * @param pipeline
     * @return
     */
    PipelineDO pipelineToPipelineDO(Pipeline pipeline);

    /**
     * PipelineDO转化为Pipeline
     * @param pipelineDO
     * @return
     */
    Pipeline pipelineDOToPipeline(PipelineDO pipelineDO);

}
